﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.models {
    import com.adobe.air.net.events.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;

    public class FriendsModel extends Actor {

        private var _friends:Array;
        private var _hiddenBirdCollectedFirstTime:Boolean;// = false
        private var _updateFriendsInCount:int;// = 0

        public function FriendsModel(){
            this._friends = [];
            super();
        }
        public function get friends():Array{
            return (this._friends);
        }
        public function set friends(_arg1:Array):void{
            this._friends = _arg1;
            dispatch(new SessionModelEvent(SessionModelEvent.ON_FRIENDS_CHANGED));
        }
        public function getFriend(_arg1:String):Object{
            var _local2:Object;
            for each (_local2 in this._friends) {
                if (_local2.uid == _arg1){
                    return (_local2);
                };
            };
            return ({});
        }
        public function removeHiddenBirdFromFriendsObject(_arg1:String):void{
            var _local2:Object;
            for each (_local2 in this._friends) {
                if (_local2.uid == _arg1){
                    _local2.bird = false;
                };
            };
        }
        public function hasHiddenBird(_arg1:String):Boolean{
            var _local2:Object;
            for each (_local2 in this._friends) {
                if (_local2.uid == _arg1){
                    return (_local2.bird);
                };
            };
            return (false);
        }
        public function getVisitingFriendObject(_arg1:String):Object{
            return (this.getFriend(_arg1));
        }
        public function sortFriends():void{
            if (this._friends){
                this._friends.sortOn(ProtocolConstants.XP, (Array.DESCENDING | Array.NUMERIC));
            };
        }
        public function get hiddenBirdCollectedFirstTime():Boolean{
            return (this._hiddenBirdCollectedFirstTime);
        }
        public function set hiddenBirdCollectedFirstTime(_arg1:Boolean):void{
            this._hiddenBirdCollectedFirstTime = _arg1;
        }
        public function get updateFriendsInCount():int{
            return (this._updateFriendsInCount);
        }
        public function set updateFriendsInCount(_arg1:int):void{
            this._updateFriendsInCount = _arg1;
        }

    }
}//package net.wooga.pets.models 
